<?php
	require("..\globals.php");
	
	$acao = $_GET["action"];

	switch($acao){
		case 1:
			echo "acao 01";
			break;
			
		case 2:
			getMenuUltimas();
	}
	
	
	function getMenuUltimas(){
		$pdo = new PDO(DSN, DB_USER, DB_PASSWORD);
		$st = $pdo->prepare("SELECT * FROM POSTAGENS");
		$result = $st->execute();

		if($result){
			while($reg = $st->fetch(PDO::FETCH_OBJ)){
				echo $reg->titulo;
			}
			
			echo "opa";
		}
		
		$pdo = null;
	}
?>